
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>佣金明细 - frm</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="../Ryancss/yongjinlog.css" rel="stylesheet" type="text/css"/>

    </head>
    <body >

	
	    <section class="aui-flexView">

            <section class="aui-scrollView">
                <div class="aui-pri-box" style="    background: linear-gradient(to right,#81FFEF 0,#F067B4 100%);">
                    <div class="aui-flex">
                        <div class="aui-pri-img">
                            <img src="" >
                        </div>
                        <div class="aui-flex-box">
                            <h2>总佣金 <em id="yongjinsu">0</em> </h2>
                            <h3>可提现 <em id="sign">0</em> </h3>
                        </div>
                        <div class="aui-pri-button" tapmode onclick="toTixian()">
                            <button>提现</button>
                        </div>
                    </div>
                </div>
                <div class="aui-list-box" id="yongjinlist">





                </div>
            </section>
        </section>
	
	
	
	

    </body>
	
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
	var api_url = localStorage.getItem('api_url');
	apiready = function(){
		
		
	/*	
				api.showProgress({
				    title: '正在加载',
				    text: '请稍等',
				    modal: false
				});
				
 	*/
	api.ajax({
        url: api_url+'/login/login/yue1.html',
        method: 'get',
        data: {
            values: {
				key: localStorage.getItem('anq_key'),   //安全码
                uid: localStorage.getItem('user_id')
            }
        }
    },function(ret, err){
        if (ret) { 
            var sign = $api.byId('sign');
			var keyong=ret.msg['share']-10;
			if(keyong <0){keyong=0;}
            sign.innerHTML = '¥ '+keyong;    //可用余额


        } else {
          api.hideProgress();
          /*
            alert('网络错误');
        */
            api.toast({
                msg: '网络错误',
                duration: 5000
            });


        }
    });
   
   
   //extract_cash();
   
		
	}
	
	


    
function extract_cash() {   //判断是否有审核



		api.ajax({
			url: api_url + '/login/login/yongjinlog.html',
			method: 'get',
			data: {
				values: {
				
					key: localStorage.getItem('anq_key'),   //安全码
					uid: localStorage.getItem('user_id')
					
				}
			}
		}, function(ret, err) {
		
		api.hideProgress(); 
			if(ret) {
			
			
			
			if(ret.code==9){   //如果没有记录
			
			yongjinlist.innerHTML = ' <div  style=" margin-top: 20px; " ><img style="width: 100%;"src=""></div>';  // 空提示
			
		/*	
			   api.toast({
                msg: ret.ts,
                duration: 5000,
				location : 'middle'   
            });
			*/
        		return;
        	}else if(ret.code==1){
			
			
								if(ret.msg['yongjinsu'] <=0) {
							
							yongjinsu.innerHTML = '¥ 0';
							
							}else{
							yongjinsu.innerHTML = '¥ '+ret.msg['yongjinsu'];
							} 
							

				
				
				var yongjinlist_frm = $api.byId('yongjinlist');//提现记录列表
				
				
				data = ret.msg['yongjinlist'];
				
				
			/////////////会员过期时间获取  方法  formatDateTime  S   ////////////
		function formatDateTime(timeStamp) {
			var date = new Date();
			date.setTime(timeStamp * 1000);
			var y = date.getFullYear();
			var m = date.getMonth() + 1;
			m = m < 10 ? ('0' + m) : m;
			var d = date.getDate();
			d = d < 10 ? ('0' + d) : d;
			var h = date.getHours();
			h = h < 10 ? ('0' + h) : h;
			var minute = date.getMinutes();
			var second = date.getSeconds();
			minute = minute < 10 ? ('0' + minute) : minute;
			second = second < 10 ? ('0' + second) : second;
			return y + '-' + m + '-' + d + ' ' + h +                                                                                                                     ':' + minute + ':' + second ;
		};

		/////////////会员过期时间获取  方法  formatDateTime  E   ////////////
	
					
				
				for(var i=0;i<data.length;i++){ 
						
				var time = data[i].time;   //先 艹
				var s1 = formatDateTime(time);
				var timestamp = Date.parse(new Date()) / 1000;
				
				var html='		<a  class="aui-list-item">'+
                   '	     <div class="aui-flex">'+
                   '	         <div class="aui-flex-box">'+
                   '	             <h4><span style="font-size: 0.8rem;padding: 0 5px 0 0;">¥</span>'+data[i].money+'</h4>'+
                   '	         </div>'+
                    '	 <div class="aui-button-get">'+
                      '	        <button>'+data[i].info+'</button>'+
                    '	        </div>'+
                  '	      </div>'+
                '	        <div class="aui-dotted">'+
                '	            <h2>时间 ：'+s1+'     <span style="font-size: 0.5rem;border: none;padding-top: 5px;float: right;">Provider ID：<em>'+data[i].give_id+'</em> </span>   </h2> '+
               '	         </div>'+
               '	     </a>	';

                    
							
							
							
							
					$api.append(yongjinlist_frm,html);
				}		
			
			
			
			
			}
			
			

				
				
			}
			


			
			
			
			
			

		}); 

   
   /////判断是否已有 提现申请




}


//
    
      function toTixian(){


        api.openWin({
            name: 'yongjin_win',
            url: 'yongjin_win.html', 
        });
		

		
		
		
		
		

    }




</script>
	
	
	
</html>